<script setup lang="ts">
import { ArrowRight, Expand, Grid } from '@element-plus/icons-vue'
import axios from '../../request/index';
import { onMounted, reactive } from 'vue';

interface emp {
    empid: number
    ename: string
    hiredate: string
    sex: number
}

let list = reactive(new Array<emp>);

let datas = reactive({
    list: list
})


onMounted(() => {
    axios({
        url: `/list.do`,
        method: "GET"
    }).then((res) => {
        //请求成功
        // alert('请求成功')
        datas.list = res.data;
        list = res.data;
        console.log(datas.list);
    }).catch((err) => {
        //请求失败
        console.log(err);
    })
})

</script>
<template>
    <div class="head">月度出勤记录</div>
    <div class="bread">
        <el-breadcrumb :separator-icon="ArrowRight">
            <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/f' }">时间管理</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/f' }">月度出勤记录</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="body">
        <div class="l1">
            <table>
                <tr v-for="(o, i) in list">
                    <td>{{ o.empid }}</td>
                    <td>{{ o.ename }}</td>
                    <td>{{ o.hiredate }}</td>
                    <td>{{ o.sex }}</td>
                </tr>
            </table>
            <hr>
            <table>
                <tr v-for="(o, i) in datas.list">
                    <td>{{ o.empid }}</td>
                    <td>{{ o.ename }}</td>
                    <td>{{ o.hiredate }}</td>
                    <td>{{ o.sex }}</td>
                </tr>
            </table>
            <hr>
            
        </div>
        <div class="l2">

        </div>
        <div class="l3">

        </div>
    </div>
</template>

<style scoped>
.l1 {
    width: 100%;
    /* background-image: url("../../img/backgrounds/1.jpg"); */
    background-repeat: no-repeat;
    background-size: cover;
    /* background-color: #777; */
    /* height: 215px; */
}

.l2 {
    width: 100%;
    /* background-color: #111; */
    height: 76px;
    display: flex;
    justify-content: center;
}

.l3 {
    width: 100%;
    /* background-color: #999; */
    height: 130px;
}


.head {
    height: 30px;
    background-color: rgb(255, 255, 255);
    line-height: 30px;
    font-size: 30px;
    padding: 25px;
    color: #000;
}

.bread {
    height: 30px;
    background-color: rgb(215, 215, 215);
    padding-top: 20px;
    padding-left: 20px;
    vertical-align: bottom;
}

.body {
    width: 100%;
    /* height: 100%; */
    background-color: rgb(255, 255, 255);
    padding: 0;
}
</style>